<html>
<head><meta charset="utf-8"><title>Front-end: debug vs opt builds · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html">Front-end: debug vs opt builds</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="200169645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/200169645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#200169645">(Jun 08 2020 at 23:54)</a>:</h4>
<p>I was hoping that <a href="https://internals.rust-lang.org/t/what-exactly-is-cargo-llvm-lines-measuring/12455">my post on internals</a> would have gotten more response, so I'll ask here. What is the difference in rustc's front-end between debug and opt builds?</p>



<a name="200169669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/200169669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#200169669">(Jun 08 2020 at 23:54)</a>:</h4>
<p>One obvious thing is that debug builds have debug assertions, so they will contain more code because of that.</p>



<a name="200169684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/200169684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#200169684">(Jun 08 2020 at 23:54)</a>:</h4>
<p>Are there other differences? Are there front-end optimizations that might result in different LLVM IR being generated for debug and opt builds?</p>



<a name="200169710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/200169710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#200169710">(Jun 08 2020 at 23:55)</a>:</h4>
<p>For example, the output of <code>cargo llvm-lines</code> suggests that some inlining occurs in the front-end in opt builds. Is that true?</p>



<a name="200169714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/200169714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#200169714">(Jun 08 2020 at 23:55)</a>:</h4>
<p>There is no difference in MIR optimizations as of now</p>



<a name="200169727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/200169727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#200169727">(Jun 08 2020 at 23:55)</a>:</h4>
<p>but overflow checks cause a difference</p>



<a name="200178968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/200178968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#200178968">(Jun 09 2020 at 03:24)</a>:</h4>
<p>Still doesn't seem like debug assertions and overflow checks are enough to account for the differences seen in some cases. I'll have to investigate more when I get some time.</p>



<a name="200185315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/200185315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#200185315">(Jun 09 2020 at 06:17)</a>:</h4>
<p>Are CGU divisions happening in the same places in debug and release?</p>



<a name="200187241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/200187241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#200187241">(Jun 09 2020 at 06:57)</a>:</h4>
<p>I don't know. Are CGU divisions something that happens in the front-end?</p>



<a name="200191417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/200191417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#200191417">(Jun 09 2020 at 07:55)</a>:</h4>
<p>yes, CGU splitting is done by rustc</p>



<a name="200210887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/200210887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#200210887">(Jun 09 2020 at 11:34)</a>:</h4>
<p>Besides CGU merging, I think there are also differences in what goes into each CGU: whether monomorphizations from upstream crates get reused (-Z share-generics) and maybe how eagerly #[inline] functions get placed in multiple CGUs. I'm not 100% sure about the latter, though, and don't have the time to check at the moment.</p>



<a name="200408890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/200408890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#200408890">(Jun 10 2020 at 12:28)</a>:</h4>
<p>There is a MIR opt for inlining, but afaik it's been skipped for both modes because of performance concerns</p>



<a name="200408915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/200408915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#200408915">(Jun 10 2020 at 12:28)</a>:</h4>
<p>There are a lot of things to improve here that should appear in the pipeline soon though</p>



<a name="200408960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/200408960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#200408960">(Jun 10 2020 at 12:29)</a>:</h4>
<p>Like:</p>
<ul>
<li>Doing different mir-opts depending on debug vs release</li>
<li>Doing different CGU partitioning depending on debug vs release</li>
</ul>



<a name="200409067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/200409067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#200409067">(Jun 10 2020 at 12:30)</a>:</h4>
<p>If I remember correctly... <span class="user-mention" data-user-id="125250">@Wesley Wiser</span> was experimenting on the CGU algorithm for debug builds? So that compilation time was improved?</p>



<a name="200409284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/200409284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#200409284">(Jun 10 2020 at 12:33)</a>:</h4>
<p>I wanted to change the settings for mir-opt so that debug and release used different sets of optimizations, but I haven't been able to seriously sit down and do it because I have a blocker on my side (life basically), which should be freeing me soon to do stuff again but no timeline yet.<br>
So if anyone wants to pick that up, write a proposal or whatever, please do, I'll be glad to give kudos and what info I have on that.</p>



<a name="202294683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202294683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202294683">(Jun 29 2020 at 10:54)</a>:</h4>
<p>I'm seeing big differences in the number of times various generic functions are instantiated in debug vs. opt builds.</p>



<a name="202294717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202294717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202294717">(Jun 29 2020 at 10:54)</a>:</h4>
<p>e.g. debug, for <code>ripgrep</code>:</p>



<a name="202294719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202294719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202294719">(Jun 29 2020 at 10:54)</a>:</h4>
<div class="codehilite"><pre><span></span><code>4593 (3.3%)   265 (6.9%)  core::ptr::drop_in_place
</code></pre></div>



<a name="202294722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202294722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202294722">(Jun 29 2020 at 10:54)</a>:</h4>
<div class="codehilite"><pre><span></span><code>2694 (1.9%)    41 (1.1%)  core::option::Option&lt;T&gt;::map
</code></pre></div>



<a name="202294731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202294731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202294731">(Jun 29 2020 at 10:54)</a>:</h4>
<div class="codehilite"><pre><span></span><code> 910 (0.7%)     5 (0.1%)  alloc::raw_vec::RawVec&lt;T,A&gt;::grow_amortized
</code></pre></div>



<a name="202294747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202294747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202294747">(Jun 29 2020 at 10:55)</a>:</h4>
<div class="codehilite"><pre><span></span><code> 594 (0.4%)     9 (0.2%)  alloc::raw_vec::RawVec&lt;T,A&gt;::current_memory
</code></pre></div>



<a name="202294776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202294776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202294776">(Jun 29 2020 at 10:55)</a>:</h4>
<p>And opt, for the same program:</p>



<a name="202294782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202294782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202294782">(Jun 29 2020 at 10:55)</a>:</h4>
<p>17023 (5.1%)   809 (8.4%)  core::ptr::drop_in_place</p>



<a name="202294796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202294796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202294796">(Jun 29 2020 at 10:55)</a>:</h4>
<div class="codehilite"><pre><span></span><code>5395 (1.6%)    72 (0.8%)  core::option::Option&lt;T&gt;::map
</code></pre></div>



<a name="202294811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202294811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202294811">(Jun 29 2020 at 10:55)</a>:</h4>
<div class="codehilite"><pre><span></span><code>6820 (2.1%)    31 (0.3%)  alloc::raw_vec::RawVec&lt;T,A&gt;::grow_amortized
</code></pre></div>



<a name="202294852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202294852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202294852">(Jun 29 2020 at 10:56)</a>:</h4>
<div class="codehilite"><pre><span></span><code>4032 (1.2%)    56 (0.6%)  alloc::raw_vec::RawVec&lt;T,A&gt;::current_memory
</code></pre></div>



<a name="202294913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202294913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202294913">(Jun 29 2020 at 10:57)</a>:</h4>
<p>These are <em>big</em> differences.</p>



<a name="202294936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202294936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202294936">(Jun 29 2020 at 10:57)</a>:</h4>
<p>How could <code>current_memory</code> be instantiated 9 times in a debug build, and 56 times in an opt build?</p>



<a name="202294945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202294945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202294945">(Jun 29 2020 at 10:58)</a>:</h4>
<p>How does it look with <code>-Ccodegen-units=1</code>? Do we instantiate generics into each CGU?</p>



<a name="202294994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202294994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202294994">(Jun 29 2020 at 10:58)</a>:</h4>
<p>We also share generics across crates in debug builds, but not in opt builds, I believe</p>



<a name="202295011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202295011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202295011">(Jun 29 2020 at 10:58)</a>:</h4>
<p>Maybe it's the stuff that <span class="user-mention" data-user-id="124289">@Hanna Kruppe</span> mentioned above</p>



<a name="202295042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202295042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202295042">(Jun 29 2020 at 10:59)</a>:</h4>
<p>Ah, yeah</p>



<a name="202299708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202299708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202299708">(Jun 29 2020 at 12:02)</a>:</h4>
<p>Related datapoint: Building rust-analyzer in release mode with <code>-Zshare-generics</code> reduces build times from 6m 27s to 3m 52s (~40% faster), with a 20% impact to runtime</p>



<a name="202299794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202299794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202299794">(Jun 29 2020 at 12:03)</a>:</h4>
<blockquote>
<p>20% impact to runtime</p>
</blockquote>
<p>That sounds like what took 100 seconds now takes 120; is that what you mean by impact?</p>



<a name="202299902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202299902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202299902">(Jun 29 2020 at 12:04)</a>:</h4>
<p>Yeah</p>



<a name="202300187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202300187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202300187">(Jun 29 2020 at 12:07)</a>:</h4>
<p>I also expect at least some of the <code>drop_in_place</code> instances to go away once MIR shims are more generic <a href="https://github.com/rust-lang/rust/issues/69925">#69925</a></p>



<a name="202376747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202376747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202376747">(Jun 29 2020 at 22:43)</a>:</h4>
<p><span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> <a href="#narrow/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds/near/202294945">said</a>:</p>
<blockquote>
<p>How does it look with <code>-Ccodegen-units=1</code>? Do we instantiate generics into each CGU?</p>
</blockquote>
<p>Doesn't make any difference</p>



<a name="202377193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Front-end%3A%20debug%20vs%20opt%20builds/near/202377193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> njn <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Front-end.3A.20debug.20vs.20opt.20builds.html#202377193">(Jun 29 2020 at 22:48)</a>:</h4>
<p><code>-Zshare-generics</code> apparently makes no difference, too</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>